package StudyCode.summary.mycollection;

import java.util.ArrayList;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class GenericMethodToCheckIfAnItemInArrayList {
	public static <T> boolean inArrayList(ArrayList<? extends T> array,
	                                      T other) {
		for (T object : array) {
			if (object.equals(other)) {
				return true;
			}
		}

		return false;
	}
}
